fix: address fragmentation v1 protocol violations and documentation gaps #722
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addressed 7 critical issues in the v1 fragmentation implementation identified during PR #503 review. These fixes improve protocol safety and clarify known limitations while v2 integration proceeds.
Changes
Fragment validation (fragmentation.rs)
fragment_index < total_fragmentsinFragmentHeader::from_bytes()Collision risk documentation (fragmentation.rs)
wrapping_sum) with explicit collision scenariosWire format compatibility (gatt.rs)
fragment_large_message()ignores itsmessage_idparameter (changed to_message_id)Stale fragment cleanup (gatt.rs)
cleanup_stale_fragments()from clearing ALL pending to logging-onlyBackward compatibility (blockchain_sync/mod.rs)
BLE_CHUNK_SIZE,WIFI_CHUNK_SIZEReassembly logging (gatt.rs)
pending_count()call after message completion (always returns 0 or unrelated count)Example
All v1 limitations are now clearly documented with migration guidance to fragmentation_v2.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.